home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Balloons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  10.0 KB  |  241 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Balloons.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __BALLOONS__
  13. #define __BALLOONS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __QUICKDRAW__
  23. #include <Quickdraw.h>
  24. /*    #include <QuickdrawText.h>                                    */
  25. /*        #include <IntlResources.h>                                */
  26. #endif
  27.  
  28. #ifndef __MENUS__
  29. #include <Menus.h>
  30. #endif
  31.  
  32. #ifndef __TEXTEDIT__
  33. #include <TextEdit.h>
  34. #endif
  35.  
  36. #ifndef __TRAPS__
  37. #endif
  38.  
  39. enum  {
  40.     hmBalloonHelpVersion        = 0x0002,                        /* The real version of the Help Manager */
  41. /*Help Mgr error range: -850 to -874*/
  42.     hmHelpDisabled                = -850,                            /* Show Balloons mode was off, call to routine ignored */
  43.     hmBalloonAborted            = -853,                            /* Returned if mouse was moving or mouse wasn't in window port rect */
  44.     hmSameAsLastBalloon            = -854,                            /* Returned from HMShowMenuBalloon if menu & item is same as last time */
  45.     hmHelpManagerNotInited        = -855,                            /* Returned from HMGetHelpMenuHandle if help menu not setup */
  46.     hmSkippedBalloon            = -857,                            /* Returned from calls if helpmsg specified a skip balloon */
  47.     hmWrongVersion                = -858,                            /* Returned if help mgr resource was the wrong version */
  48.     hmUnknownHelpType            = -859,                            /* Returned if help msg record contained a bad type */
  49.     hmOperationUnsupported        = -861,                            /* Returned from HMShowBalloon call if bad method passed to routine */
  50.     hmNoBalloonUp                = -862,                            /* Returned from HMRemoveBalloon if no balloon was visible when call was made */
  51.     hmCloseViewActive            = -863,                            /* Returned from HMRemoveBalloon if CloseView was active */
  52.     kHMHelpMenuID                = -16490,                        /* Resource ID and menu ID of help menu */
  53.     kHMAboutHelpItem            = 1,                            /* help menu item number of About Balloon Help… */
  54.     kHMShowBalloonsItem            = 3,                            /* help menu item number of Show/Hide Balloons */
  55.     kHMHelpID                    = -5696,                        /* ID of various Help Mgr package resources (in Pack14 range) */
  56.     kBalloonWDEFID                = 126,                            /* Resource ID of the WDEF proc used in standard balloons */
  57. /* Dialog item template type constant */
  58.     helpItem                    = 1,                            /* key value in DITL template that corresponds to the help item */
  59. /* Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  60.     hmDefaultOptions            = 0,                            /* default options for help manager resources */
  61.     hmUseSubID                    = 1,                            /* treat resID's in resources as subID's of driver base ID (for Desk Accessories) */
  62.     hmAbsoluteCoords            = 2                                /* ignore window port origin and treat rectangles as absolute coords (local to window) */
  63. };
  64.  
  65. enum  {
  66.     hmSaveBitsNoWindow            = 4,                            /* don't create a window, just blast bits on screen. No update event is generated */
  67.     hmSaveBitsWindow            = 8,                            /* create a window, but restore bits behind window when window goes away & generate update event */
  68.     hmMatchInTitle                = 16,                            /* for hwin resources, match string anywhere in window title string */
  69. /* Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  70.     kHMStringItem                = 1,                            /* pstring used in resource */
  71.     kHMPictItem                    = 2,                            /* 'PICT' ResID used in resource */
  72.     kHMStringResItem            = 3,                            /* 'STR#' ResID & index used in resource */
  73.     kHMTEResItem                = 6,                            /* Styled Text Edit ResID used in resource ('TEXT' & 'styl') */
  74.     kHMSTRResItem                = 7,                            /* 'STR ' ResID used in resource */
  75.     kHMSkipItem                    = 256,                            /* don't display a balloon */
  76.     kHMCompareItem                = 512,                            /* Compare pstring in menu item w/ PString in resource item ('hmnu' only) */
  77.     kHMNamedResourceItem        = 1024,                            /* Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) */
  78.     kHMTrackCntlItem            = 2048,                            /* Reserved */
  79. /* Constants for hmmHelpType's when filling out HMMessageRecord */
  80.     khmmString                    = 1,                            /* help message contains a PString */
  81.     khmmPict                    = 2,                            /* help message contains a resource ID to a 'PICT' resource */
  82.     khmmStringRes                = 3,                            /* help message contains a res ID & index to a 'STR#' resource */
  83.     khmmTEHandle                = 4,                            /* help message contains a Text Edit handle */
  84.     khmmPictHandle                = 5,                            /* help message contains a Picture handle */
  85.     khmmTERes                    = 6,                            /* help message contains a res ID to 'TEXT' & 'styl' resources */
  86.     khmmSTRRes                    = 7,                            /* help message contains a res ID to a 'STR ' resource */
  87.     kHMEnabledItem                = 0                                /* item is enabled, but not checked or control value = 0 */
  88. };
  89.  
  90.  
  91. /* ResTypes for Styled TE Handles in Resources */
  92.  
  93. #define kHMTETextResType 'TEXT'
  94.  
  95. #define kHMTEStyleResType 'styl'
  96.  
  97. enum  {
  98.     kHMDisabledItem                = 1,                            /* item is disabled, grayed in menus or disabled in dialogs */
  99.     kHMCheckedItem                = 2,                            /* item is enabled, and checked or control value = 1 */
  100.     kHMOtherItem                = 3,                            /* item is enabled, and control value > 1 */
  101. /* Method parameters to pass to HMShowBalloon */
  102.     kHMRegularWindow            = 0,                            /* Create a regular window floating above all windows */
  103.     kHMSaveBitsNoWindow            = 1,                            /* Just save the bits and draw (for MDEF calls) */
  104.     kHMSaveBitsWindow            = 2                                /* Regular window, save bits behind, AND generate update event */
  105. };
  106.  
  107.  
  108. /* Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages */
  109.  
  110. #define kHMMenuResType 'hmnu'
  111.  
  112. #define kHMDialogResType 'hdlg'
  113.  
  114. #define kHMWindListResType 'hwin'
  115.  
  116. #define kHMRectListResType 'hrct'
  117.  
  118. #define kHMOverrideResType 'hovr'
  119.  
  120. #define kHMFinderApplResType 'hfdr'
  121.  
  122. #if defined(powerc) || defined (__powerc)
  123. #pragma options align=mac68k
  124. #endif
  125. struct HMStringResType {
  126.     short                        hmmResID;
  127.     short                        hmmIndex;
  128. };
  129. #if defined(powerc) || defined(__powerc)
  130. #pragma options align=reset
  131. #endif
  132.  
  133. typedef struct HMStringResType HMStringResType;
  134.  
  135. #if defined(powerc) || defined (__powerc)
  136. #pragma options align=mac68k
  137. #endif
  138. struct HMMessageRecord {
  139.     short                        hmmHelpType;
  140.     union {
  141.         char                        hmmString[256];
  142.         short                        hmmPict;
  143.         TEHandle                    hmmTEHandle;
  144.         HMStringResType                hmmStringRes;
  145.         short                        hmmPictRes;
  146.         PicHandle                    hmmPictHandle;
  147.         short                        hmmTERes;
  148.         short                        hmmSTRRes;
  149.     }                            u;
  150. };
  151. #if defined(powerc) || defined(__powerc)
  152. #pragma options align=reset
  153. #endif
  154.  
  155. typedef struct HMMessageRecord HMMessageRecord;
  156.  
  157. typedef HMMessageRecord *HMMessageRecPtr;
  158.  
  159. typedef pascal OSErr (*TipFunctionProcPtr)(Point tip, RgnHandle structure, Rect *r, short *variant);
  160.  
  161. enum {
  162.     uppTipFunctionProcInfo = kPascalStackBased
  163.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  164.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point)))
  165.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RgnHandle)))
  166.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Rect*)))
  167.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short*)))
  168. };
  169.  
  170. #if USESROUTINEDESCRIPTORS
  171. typedef UniversalProcPtr TipFunctionUPP;
  172.  
  173. #define CallTipFunctionProc(userRoutine, tip, structure, r, variant)        \
  174.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTipFunctionProcInfo, (tip), (structure), (r), (variant))
  175. #define NewTipFunctionProc(userRoutine)        \
  176.         (TipFunctionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTipFunctionProcInfo, GetCurrentISA())
  177. #else
  178. typedef TipFunctionProcPtr TipFunctionUPP;
  179.  
  180. #define CallTipFunctionProc(userRoutine, tip, structure, r, variant)        \
  181.         (*(userRoutine))((tip), (structure), (r), (variant))
  182. #define NewTipFunctionProc(userRoutine)        \
  183.         (TipFunctionUPP)(userRoutine)
  184. #endif
  185.  
  186. #ifdef __cplusplus
  187. extern "C" {
  188. #endif
  189.  
  190.  
  191. /*  Public Interfaces  */
  192.  
  193. extern pascal OSErr HMGetHelpMenuHandle(MenuHandle *mh)
  194.  THREEWORDINLINE(0x303C, 0x0200, 0xA830);
  195. extern pascal OSErr HMShowBalloon(const HMMessageRecord *aHelpMsg, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, short theProc, short variant, short method)
  196.  THREEWORDINLINE(0x303C, 0x0B01, 0xA830);
  197. extern pascal OSErr HMRemoveBalloon(void)
  198.  THREEWORDINLINE(0x303C, 0x0002, 0xA830);
  199. extern pascal Boolean HMGetBalloons(void)
  200.  THREEWORDINLINE(0x303C, 0x0003, 0xA830);
  201. extern pascal OSErr HMSetBalloons(Boolean flag)
  202.  THREEWORDINLINE(0x303C, 0x0104, 0xA830);
  203. extern pascal OSErr HMShowMenuBalloon(short itemNum, short itemMenuID, long itemFlags, long itemReserved, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, short theProc, short variant)
  204.  THREEWORDINLINE(0x303C, 0x0E05, 0xA830);
  205. extern pascal OSErr HMGetIndHelpMsg(ResType whichType, short whichResID, short whichMsg, short whichState, long *options, Point *tip, Rect *altRect, short *theProc, short *variant, HMMessageRecord *aHelpMsg, short *count)
  206.  THREEWORDINLINE(0x303C, 0x1306, 0xA830);
  207. extern pascal Boolean HMIsBalloon(void)
  208.  THREEWORDINLINE(0x303C, 0x0007, 0xA830);
  209. extern pascal OSErr HMSetFont(short font)
  210.  THREEWORDINLINE(0x303C, 0x0108, 0xA830);
  211. extern pascal OSErr HMSetFontSize(short fontSize)
  212.  THREEWORDINLINE(0x303C, 0x0109, 0xA830);
  213. extern pascal OSErr HMGetFont(short *font)
  214.  THREEWORDINLINE(0x303C, 0x020A, 0xA830);
  215. extern pascal OSErr HMGetFontSize(short *fontSize)
  216.  THREEWORDINLINE(0x303C, 0x020B, 0xA830);
  217. extern pascal OSErr HMSetDialogResID(short resID)
  218.  THREEWORDINLINE(0x303C, 0x010C, 0xA830);
  219. extern pascal OSErr HMSetMenuResID(short menuID, short resID)
  220.  THREEWORDINLINE(0x303C, 0x020D, 0xA830);
  221. extern pascal OSErr HMBalloonRect(const HMMessageRecord *aHelpMsg, Rect *coolRect)
  222.  THREEWORDINLINE(0x303C, 0x040E, 0xA830);
  223. extern pascal OSErr HMBalloonPict(const HMMessageRecord *aHelpMsg, PicHandle *coolPict)
  224.  THREEWORDINLINE(0x303C, 0x040F, 0xA830);
  225. extern pascal OSErr HMScanTemplateItems(short whichID, short whichResFile, ResType whichType)
  226.  THREEWORDINLINE(0x303C, 0x0410, 0xA830);
  227. extern pascal OSErr HMExtractHelpMsg(ResType whichType, short whichResID, short whichMsg, short whichState, HMMessageRecord *aHelpMsg)
  228.  THREEWORDINLINE(0x303C, 0x0711, 0xA830);
  229. extern pascal OSErr HMGetDialogResID(short *resID)
  230.  THREEWORDINLINE(0x303C, 0x0213, 0xA830);
  231. extern pascal OSErr HMGetMenuResID(short menuID, short *resID)
  232.  THREEWORDINLINE(0x303C, 0x0314, 0xA830);
  233. extern pascal OSErr HMGetBalloonWindow(WindowPtr *window)
  234.  THREEWORDINLINE(0x303C, 0x0215, 0xA830);
  235. #ifdef __cplusplus
  236. }
  237. #endif
  238.  
  239. #endif
  240.  
  241.